#########################################################################
##
## This file is part of the SAMRAI distribution.  For full copyright 
## information, see COPYRIGHT and LICENSE. 
##
## Copyright:     (c) 1997-2019 Lawrence Livermore National Security, LLC
## Description:   makefile for fortran files for SAMRAI linear advection
##                performance test
##
#########################################################################

SAMRAI        = @top_srcdir@
SRCDIR        = @srcdir@
SUBDIR        = source/test/performance/LinAdv/fortran
VPATH         = @srcdir@
OBJECT        = ../../../../..

default: main

include $(OBJECT)/config/Makefile.config

F_OBJS = flux3d.o fluxcorner3d.o grad3d.o init3d.o stable3d.o stufprobc3d.o \
	 trace3d.o trace1d3d.o \
	 flux2d.o grad2d.o init2d.o stable2d.o stufprobc2d.o trace2d.o \
	 trace1d2d.o

main:	$(F_OBJS)

clean:
	$(CLEAN_COMMON_TEST_FILES)

include $(SRCDIR)/Makefile.depend

M4DIRS = -DFORTDIR=$(SRCDIR) $(SAMRAI_M4_FLAGS)

flux2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/flux2d.m4 > flux2d.f
	$(F77) $(FFLAGS) -c flux2d.f -o $@

grad2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/grad2d.m4 > grad2d.f
	$(F77) $(FFLAGS) -c grad2d.f -o $@

init2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/init2d.m4 > init2d.f
	$(F77) $(FFLAGS) -c init2d.f -o $@

stable2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/stable2d.m4 > stable2d.f
	$(F77) $(FFLAGS) -c stable2d.f -o $@

stufprobc2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/stufprobc2d.m4 > stufprobc2d.f
	$(F77) $(FFLAGS) -c stufprobc2d.f -o $@

trace2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/trace2d.m4 > trace2d.f
	$(F77) $(FFLAGS) -c trace2d.f -o $@

trace1d2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/trace1d2d.m4 > trace1d2d.f
	$(F77) $(FFLAGS) -c trace1d2d.f -o $@

flux3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/flux3d.m4 > flux3d.f
	$(F77) $(FFLAGS) -c flux3d.f -o $@

fluxcorner3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/fluxcorner3d.m4 > fluxcorner3d.f
	$(F77) $(FFLAGS) -c fluxcorner3d.f -o $@

grad3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/grad3d.m4 > grad3d.f
	$(F77) $(FFLAGS) -c grad3d.f -o $@

init3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/init3d.m4 > init3d.f
	$(F77) $(FFLAGS) -c init3d.f -o $@

stable3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/stable3d.m4 > stable3d.f
	$(F77) $(FFLAGS) -c stable3d.f -o $@

stufprobc3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/stufprobc3d.m4 > stufprobc3d.f
	$(F77) $(FFLAGS) -c stufprobc3d.f -o $@

trace3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/trace3d.m4 > trace3d.f
	$(F77) $(FFLAGS) -c trace3d.f -o $@

trace1d3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/trace1d3d.m4 > trace1d3d.f
	$(F77) $(FFLAGS) -c trace1d3d.f -o $@
